﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataManager.TablesManager;
using DataManager;
using System.ServiceModel.Web;

namespace ConsoleService
{
    class Services_Mess : I_Services_Mess
    {

        #region I_Services_Mess Members
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "login/{username}/{password}")]
        string I_Services_Mess.login(string username, string password)
        {
            ACCOUNT ac = new AccountManager().SelectByID<ACCOUNT>(username);
            if (ac != null)
            {
                if (ac.PASS == Library.EncodePassword(password))
                {
                    return "true";
                }
            }
            return "false";
        }

        #endregion

        #region I_Services_Mess Members

        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "login/{username}")]
        string I_Services_Mess.test(string username)
        {
            return "Khoa";
        }

        #endregion
    }
}
